from Day19.Base import Base
from selenium.webdriver.common.by import By
from time import sleep

class Page(Base):

    kuang = (By.XPATH,'/html/body/div[1]/div[2]/div[1]/ul/li[1]/a')
    def dushu(self):
        self.click(self.kuang)

    pw_login = (By.XPATH,'/html/body/div[3]/div[2]/div/div[1]/div[1]/div[2]/div[1]/div/ul[2]/li[1]/div[1]/a/img')
    def shu(self):
        self.click(self.pw_login)

    username = (By.XPATH,'/html/body/div[3]/div[1]/div/div[2]/h2[1]/span[2]/a')
    def quanbu(self):
        self.click(self.username)

    pwd = (By.XPATH,'/html/body/div[3]/div[1]/div/div[1]/ul/li[1]/div[2]/a/img')
    def kuangren(self):
        self.click(self.pwd)

    login_btn = (By.XPATH,'/html/body/div[3]/div[1]/div/div[1]/div[1]/div[2]/div/a')

    def beijing(self):
        self.click(self.login_btn)


    def test_LuoJi_DouBan(self):
        self.open_url('https://www.douban.com/')
        sleep(2)
        self.dushu()
        sleep(2)
        self.window_qiehuan()
        sleep(2)

        self.shu()
        sleep(2)

        self.quanbu()
        sleep(2)
        self.kuangren()
        sleep(2)
        self.beijing()
        sleep(5)


